import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/login",
    name: "Login",
    component: () => import("../views/Login.vue")
  },
  {
    path: "/",
    name: "Home",
    redirect: "/welcome",
    component: () => import("../views/Home.vue"),
    children: [
      {
        path: "/welcome",
        name: "Welcome",
        component: () => import("../views/Welcome.vue")
      },
      {
        path: "/users",
        name: "Users",
        component: () => import("../views/user/Users.vue")
      },
      {
        path: "/roles",
        name: "Roles",
        component: () => import("../views/power/Roles.vue")
      },
      {
        path: "/power",
        name: "Power",
        component: () => import("../views/power/Power.vue")
      },
      {
        path: "/goods",
        name: "Goods",
        component: () => import("../views/goods/Goods.vue")
      },
      {
        path: "/params",
        name: "Params",
        component: () => import("../views/goods/Params.vue")
      },
      {
        path: "/categories",
        name: "Categories",
        component: () => import("../views/goods/Categories.vue")
      },
      {
        path: "/orders",
        name: "Orders",
        component: () => import("../views/order/Orders.vue")
      },
      {
        path: "/reports",
        name: "Reports",
        component: () => import("../views/infomation/Reports.vue")
      }
    ]
  }
];

const router = new VueRouter({
  routes
});

export default router;
